{% extends extends_template %}

{% block location %}
<div class="nav"><a href="{% url accounts %}">Accounts</a></div>
	{% if account %}
	   <div class="nav"><a href="{% url account_details account_id=account.id %}">{{account.name}}</a></div>
	   <div class="nav"><a href="{% url list_account_cards account_id=account.id %}">Cards</a></div>
	{% else %}
	   <div class="nav"><a href="{% url list_cards %}">Cards</a></div>
	{% endif %}
{% endblock %}

{% block content %}
<div id="cards">
    {% block cards %}
    {% if cards %}
		{% if account %}
            {% if cli %}
                {% include 'cli/cli_card_table.html' with cards=cards cards_caption=account.name %}
            {% else %}
                {% include 'card_table.html' with cards=cards cards_caption=account.name %}
            {% endif %}
		{% else %}
            {% if cli %}
                {% include 'cli/cli_card_table.html' with cards=cards %}
            {% else %}
                {% include 'card_table.html' with cards=cards %}
            {% endif %}
        {% endif %}
    {% else %}
    <p>No cards</p>
    {% endif %}
    {% endblock %}
</div>
{% endblock %}
